﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Management;
using System.Text;

namespace WMI.NET.CIM
{
    /// <summary>
    /// The CIM_DiskPartition class represents a contiguous range of logical blocks that is identifiable by the operating system by way of the partition's type and subtype fields. Disk partitions should be directly realized by physical media (indicated by the CIM_RealizesDiskPartition association) or built on storage volumes.
    /// </summary>
    public class CIM_DiskPartition : CIM_StorageExtent
    {

        private Nullable<Boolean> _Bootable;
        private Nullable<Boolean> _PrimaryPartition;

        /// <summary>
        /// If TRUE, the disk partition is labeled as bootable. This does not mean that an operating system is loaded on the partition.
        /// </summary>
        public Nullable<Boolean> Bootable { get { return _Bootable; } }

        /// <summary>
        /// If TRUE, the disk partition is labeled as the primary partition for a computer system.
        /// </summary>
        public Nullable<Boolean> PrimaryPartition { get { return _PrimaryPartition; } }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="mbo"></param>
        public CIM_DiskPartition(ManagementBaseObject mbo)
            :base(mbo)
        {
            _Bootable = mbo.GetBoolValue("Bootable");
            _PrimaryPartition = mbo.GetBoolValue("PrimaryPartition");
        }

    }
}
